/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.mk.transaction.spkdetail;

import com.buanalintas.bynga.Action;
import com.buanalintas.bynga.Field;
import com.buanalintas.bynga.Page;
import com.ronsicecream.pos.entities.PosTransactionMkWorkOrderDetail;

/**
 *
 * @author user
 */
public class SpkDetail extends Page{
    private Field workOrderDetailId;
    
    private Field workOrderDetailQuantity;
    
    private Field workOrderDetailSent;
    
    private Field workOrderDetailUnsent;
    
    private Field workOrderDetailPrice;
    
    private Field workOrderDetailDescription;
    
//    private Field purchaseOrderDetailSatuanId;
    
    private Field workOrderDetailItemId;
    
    private Field workOrderDetailWorkOrderId;
    

    public SpkDetail() {
        super();

        setTheClass(PosTransactionMkWorkOrderDetail.class);
        
        
        
        
        workOrderDetailId = new Field();
        workOrderDetailId.setName("workOrderDetailId");
        workOrderDetailId.setCaption("id");
        //purchaseOrderDetailId.setInfo("purchase order detail id");
        workOrderDetailId.setListProperties(" align=\"left\"  nowrap");
        workOrderDetailId.setInputProperties(" size=\"20\"");        
        getFields().add(workOrderDetailId);
        
        workOrderDetailQuantity = new Field();
        workOrderDetailQuantity.setName("workOrderDetailQuantity");
        workOrderDetailQuantity.setCaption("quantity");
        workOrderDetailQuantity.setRequired(true);
        workOrderDetailQuantity.setDefaultValue(0);
        workOrderDetailQuantity.setListProperties(" align=\"left\" width=\"10%\" nowrap");
        workOrderDetailQuantity.setInputProperties(" size=\"20\"");        
        getFields().add(workOrderDetailQuantity);
        
        workOrderDetailSent = new Field();
        workOrderDetailSent.setName("workOrderDetailSent");
        workOrderDetailSent.setCaption("sent");
        //purchaseOrderDetailSent.setInfo("purchase order detail sent");
        workOrderDetailSent.setListProperties(" align=\"left\" width=\"10%\" nowrap");
        workOrderDetailSent.setInputProperties(" size=\"20\"");        
        getFields().add(workOrderDetailSent);
        
        workOrderDetailUnsent = new Field();
        workOrderDetailUnsent.setName("workOrderDetailUnsent");
        workOrderDetailUnsent.setCaption("unsent");
        //purchaseOrderDetailUnsent.setInfo("purchase order detail unsent");
        workOrderDetailUnsent.setListProperties(" align=\"left\" width=\"10%\" nowrap");
        workOrderDetailUnsent.setInputProperties(" size=\"20\"");        
        getFields().add(workOrderDetailUnsent);
        
        workOrderDetailPrice = new Field();
        workOrderDetailPrice.setName("workOrderDetailPrice");
        workOrderDetailPrice.setCaption("price");
        workOrderDetailPrice.setRequired(true);
        workOrderDetailPrice.setDefaultValue(0);
        workOrderDetailPrice.setListProperties(" align=\"left\" width=\"10%\" nowrap");
        workOrderDetailPrice.setInputProperties(" size=\"20\"");        
        getFields().add(workOrderDetailPrice);
        
        workOrderDetailDescription = new Field();
        workOrderDetailDescription.setName("workOrderDetailDescription");
        workOrderDetailDescription.setCaption("description");
        //purchaseOrderDetailDescription.setInfo("purchase order detail description");
        workOrderDetailDescription.setListProperties(" align=\"left\" width=\"30%\" nowrap");
        workOrderDetailDescription.setInputProperties(" cols=\"50\" rows=\"5\"");
        workOrderDetailDescription.setInputType(Field.INPUT_TEXT_AREA);
        workOrderDetailDescription.setInputCase(Field.CASE_UPPER);     
        getFields().add(workOrderDetailDescription);
        
//        purchaseOrderDetailSatuanId = new Field();
//        purchaseOrderDetailSatuanId.setName("purchaseOrderDetailSatuanId");
//        purchaseOrderDetailSatuanId.setCaption("satuan");
//        purchaseOrderDetailSatuanId.setRequired(true);
//        purchaseOrderDetailSatuanId.setListProperties(" align=\"left\" width=\"5%\" nowrap");
//        purchaseOrderDetailSatuanId.setInputProperties(" size=\"20\"");        
//        getFields().add(purchaseOrderDetailSatuanId);
        
        workOrderDetailItemId = new Field();
        workOrderDetailItemId.setName("workOrderDetailItemId");
        workOrderDetailItemId.setCaption("item");
        workOrderDetailItemId.setRequired(true);
//        workOrderDetailItemId.setSelectorCondition(" t.itemTypeId.typeId=1");
//        workOrderDetailItemId.getSelectorAction().add(new String[]{"value", "workOrderDetailPrice", "itemPriceBuy"}); 
//        workOrderDetailItemId.getSelectorColumns().add(new String[]{"itemName", " Name", " align=\"center\" width=\"10%\" nowrap"});
//        workOrderDetailItemId.getSelectorColumns().add(new String[]{"itemSatuanId", " Satuan", "align=\"left\" width=\"60%\""});
//        workOrderDetailItemId.getSelectorColumns().add(new String[]{"itemPriceBuy", "Price Buy", " align=\"center\" width=\"20%\" nowrap"});
        workOrderDetailItemId.getSelectorColumns().add(new String[]{"itemName", " Nama", "width=\"40%\""});
        workOrderDetailItemId.getSelectorColumns().add(new String[]{"itemCode", " Code", "width=\"10%\" nowrap"});
        workOrderDetailItemId.getSelectorColumns().add(new String[]{"itemTypeId", " Type", "width=\"20%\""});
        workOrderDetailItemId.getSelectorColumns().add(new String[]{"itemMinimum", " Minimum", "width=\"10%\""});
        workOrderDetailItemId.getSelectorColumns().add(new String[]{"itemSatuanId", " Satuan", "width=\"10%\""});
        workOrderDetailItemId.getSelectorColumns().add(new String[]{"itemRasaId", " Rasa", "width=\"10%\""});
        workOrderDetailItemId.setSelectorOrder("t.itemName");
        workOrderDetailItemId.setListProperties(" align=\"left\" width=\"30%\" nowrap");
        workOrderDetailItemId.setInputProperties(" size=\"20\"");        
        getFields().add(workOrderDetailItemId);
        
        workOrderDetailWorkOrderId = new Field();
        workOrderDetailWorkOrderId.setName("workOrderDetailWorkOrderId");
        workOrderDetailWorkOrderId.setCaption(" spkr ");
        //posTransactionPurchaseOrderSupplier.setInfo("pos transaction purchase order supplier");
        workOrderDetailWorkOrderId.setListProperties(" align=\"left\" nowrap");
        workOrderDetailWorkOrderId.setInputProperties(" size=\"20\"");        
        getFields().add(workOrderDetailWorkOrderId);
        
        getActions().add(Action.TRANS_DETAIL_LIST);
        getActions().add(Action.TRANS_DETAIL_ADD);
        getActions().add(Action.TRANS_DETAIL_EDIT);
        
        fillFields();
        
        getFieldsAdd().clear();
        getFieldsAdd().add(workOrderDetailItemId);
        getFieldsAdd().add(workOrderDetailQuantity);
//        getFieldsAdd().add(purchaseOrderDetailSatuanId);
        getFieldsAdd().add(workOrderDetailPrice);

        getFieldsEdit().clear();
        getFieldsEdit().add(workOrderDetailItemId);
        getFieldsEdit().add(workOrderDetailQuantity);
//        getFieldsEdit().add(purchaseOrderDetailSatuanId);
        getFieldsEdit().add(workOrderDetailPrice);
 

        getFieldsList().clear();
        getFieldsList().add(workOrderDetailItemId);
        getFieldsList().add(workOrderDetailQuantity);
//        getFieldsList().add(purchaseOrderDetailSatuanId);
        getFieldsList().add(workOrderDetailPrice);
        getFieldsList().add(workOrderDetailSent);
        getFieldsList().add(workOrderDetailUnsent);
    }
}
